const { Schema, model } = require("mongoose");

const workSchema = new Schema({
  workId: {
    type: Number,
    unique: true,
    required: true,
  },
  title: {
    type: String,
    required: true,
    min: 1,
  },
  category: {
    type: [String],
  },
  chapterNums: {
    type: Number,
  },
  status: {
    type: String,
  },
  cover_image: {
    type: URL,
  },
  tags: {
    type: [String],
  },
  author: {
    type: String,
  },
  favorite: {
    type: Number,
  },
  desc: {
    type: String,
  },
  brief: {
    type: String,
  },
  createdTime: {
    type: Date,
  },
  updateTime: {
    type: Date,
  },
});

module.exports.WorkModel = model("workModel", workSchema);
